<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">

<title>电子文档系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<script type="text/javascript" src="view/jquery/jquery-1.9.1.js"></script>
	<script type="text/javascript" src="view/js/docMan.js"></script>
	<script type="text/javascript" src="view/bootstrap/js/bootstrap.js"></script>
<link rel="stylesheet" href="view/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="zcfg/css/menu_left.css" media="screen" />

<script language="JavaScript">
<!--//
	function ShowMenu(obj, n) {
		var Nav = obj.parentNode;
		if (!Nav.id) {
			var BName = Nav.getElementsByTagName("ul");
			var HName = Nav.getElementsByTagName("h2");
			var t = 2;
		} else {
			var BName = document.getElementById(Nav.id).getElementsByTagName(
					"span");
			var HName = document.getElementById(Nav.id).getElementsByTagName(
					"h1");
			var t = 1;
		}
		for (var i = 0; i < HName.length; i++) {
			HName[i].innerHTML = HName[i].innerHTML.replace("-", "+");
			HName[i].className = "";
		}
		obj.className = "h" + t;
		for (var i = 0; i < BName.length; i++) {
			if (i != n) {
				BName[i].className = "no";
			}
		}
		if (BName[n].className == "no") {
			BName[n].className = "";
			obj.innerHTML = obj.innerHTML.replace("+", "-");
		} else {
			BName[n].className = "no";
			obj.className = "";
			obj.innerHTML = obj.innerHTML.replace("-", "+");
		}
	}
	//-->
	$(function() {
		var date=new Date();
		var j=0;
		for(var i=date.getFullYear();i>=2008;i--){
		 	var s="<h1 onClick=\"javascript:ShowMenu(this,"+j+")\">"+
						"<a href=\"javascript:void(0)\" style=\"font-size:14px;\">+ "+i+"年公文</a>"+
					"</h1>"+
					"<span class=\"no\" >"+
						"<h2 >"+
						"	<a id="+i+"  name=\"国土资源部\" href=\"javascript:void(0)\" style=\"font-size:13px;\">部内文件</a></a>"+
						"</h2>"+
						"<h2 >"+
						"	<a id="+i+" name=\"省国土资源厅\" href=\"javascript:void(0)\" style=\"font-size:13px;\">省厅文件</a>"+
						"</h2>"+
						"<h2 >"+
						"	<a id="+i+" name=\"宁波市政府集合\" href=\"javascript:void(0)\" style=\"font-size:13px;\">市政府文件</a>"+
						"</h2>"+
						"<h2 >"+
						"	<a id="+i+" name=\"宁波市国土资源局\" href=\"javascript:void(0)\" style=\"font-size:13px;\">市局文件</a>"+
						"</h2>"+
						"<h2 >"+
						"	<a id="+i+" name=\"其他\" href=\"javascript:void(0)\" style=\"font-size:13px;\">其他文件</a>"+
						"</h2>"+
					"</span>"
			$("#menu").append(s); 
			j++;
		}
		$("#menu ul li").on("click", function() {
			$("#menu ul li").removeClass("selected");
			$(this).addClass("selected");
		});
		$("#menu h2").on("click", function() {
			$("#menu h2").removeClass("selected");
			$(this).addClass("selected");
			$("#menu h2 ").each(function(i,ele){
				$(ele).css("background-color","#F4F4F4");
			})
			$(this).css("background-color","#277fc2");
		});
		$("#menu h2").on("click","a",function(){
			var type=$(this).attr("name");
			var nd=$(this).attr("id");
			console.info(type+nd);
			var qt=false;
			if(type=="其他"){
				qt=true;
			}
			var url="/DocMan/gwllSearch.action?nd="+nd+"&gwllSearchType="+type+"&isQtSearch="+qt+"&danganPage.currentPage=1&isqtlwdw=false";
			$("#gwllIframe").attr("src",url);
		});
	});
	
</script>
</head>

<body style="background: #EDEFF0;">
	<div class="top" style="position: inherit;">
		<div style="float: left">
			<span
				style="font-size: 16px;line-height: 45px;padding-left: 20px;color: #fff；margin-left:30px;">公文浏览</span>
		</div>
		<div style="float:left">
			<span
				style="font-size: 16px;line-height: 45px;padding-left: 20px;color: #fff">
			</span>
		</div>
		<div style="float:right" id="ad_setting" class="ad_setting">
			<a class="ad_setting_a" href="javascript:;"></a>
		</div>
	</div>
	<div id="menu" class="left-menu" style="width:15%;">
	</div>
	<div id="show_hide_btn" style="float:left;margin-left:15%;height:100%;vertical-align: middle;width:30px;;background-color: #ffffff;padding-left:5px;cursor: pointer;">
		<span class="glyphicon glyphicon-chevron-left" id="show_icon" style="position:absolute;top:48%;font-size:20px;" >
		</span>
	</div>
	<div class="right-content" style="margin-left:16%;">
		 <div class="content">
        <div id="page_content">
            <iframe id="gwllIframe" name="" src="" style="overflow:visible;"
                    scrolling="yes" frameborder="no" width="100%" height="100%"></iframe>
        </div>
    </div>		
	</div>
</body>
</html>

<script type="text/javascript">
	$("#show_hide_btn").on("click",function(){
		if($("#show_icon").hasClass("glyphicon-chevron-left")){
			$("#show_icon").removeClass("glyphicon-chevron-left");
			$("#show_icon").addClass("glyphicon-chevron-right");
			$("#menu").toggle();
			$(".right-content").css("margin-left",0);
			$(this).css("margin-left",0);
		}else{
			$("#show_icon").removeClass("glyphicon-chevron-right");
			$("#show_icon").addClass("glyphicon-chevron-left");
			$(".right-content").css("margin-left","16%");
			$(this).css("margin-left","15%");
			$("#menu").toggle();
		}
	})
	function hideleft(){
		$("#show_icon").removeClass("glyphicon-chevron-left");
		$("#show_icon").addClass("glyphicon-chevron-right");
		$("#menu").toggle();
		$(".right-content").css("margin-left",0);
		$("#show_hide_btn").css("margin-left",0);
	}
	function showleft(){
		$("#show_icon").removeClass("glyphicon-chevron-right");
		$("#show_icon").addClass("glyphicon-chevron-left");
		$(".right-content").css("margin-left","16%");
		$("#show_hide_btn").css("margin-left","15%");
		$("#menu").toggle();
	}
</script>
